home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Technology Seed / Mac Tech Seed Feb '96 / Mac Tech Seed Feb '96.toast / pc / develop / include / qtw.h < prev   
Encoding:
C/C++ Source or Header  |  1996-01-08  |  31.6 KB  |  761 lines

  1.  
  2.  
  3. // ---------------------------------------------------------------------
  4. //
  5. // QTW.H - QuickTime for Windows C and C++ Bindings
  6. //
  7. //         Version 2.0
  8. //
  9. //         (c) Copyright 1988-1994 Apple Computer, Inc. All Rights Reserved.
  10. //
  11. // ---------------------------------------------------------------------
  12.  
  13.  
  14. // Prevent multiple inclusion
  15. // --------------------------
  16. #ifndef __QTW_H__
  17. #define __QTW_H__
  18.  
  19. #ifdef QTW_PASCAL
  20.     #undef QTW_PASCAL
  21. #endif
  22. #ifdef _WIN32
  23.     #define QTW_PASCAL __cdecl
  24. #else
  25.     #define QTW_PASCAL PASCAL
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. // Movie Controller MCDoAction action constants
  32. // --------------------------------------------
  33. typedef enum
  34.   {mcActionIdle                   =  1, // No Param
  35.    mcActionDraw                   =  2, // No Param
  36.    mcActionActivate               =  3, // No param
  37.    mcActionDeactivate             =  4, // No param
  38.    mcActionMouseDown              =  5, // Param is pointer to EventRecord
  39.    mcActionKey                    =  6, // Param is pointer to MSG
  40.    mcActionPlay                   =  8, // Param is LFIXED play rate
  41.    mcActionGoToTime               = 12, // Param is pointer to TimeRecord
  42.    mcActionSetVolume              = 14, // Param is SFIXED volume
  43.    mcActionGetVolume              = 15, // Param is pointer to SFIXED volume
  44.    mcActionStep                   = 18, // Param is LONG number of steps
  45.    mcActionSetLooping             = 21, // Param is a Boolean
  46.    mcActionGetLooping             = 22, // Param is pointer to a Boolean
  47.    mcActionSetLoopIsPalindrome    = 23, // Param is Boolean
  48.    mcActionGetLoopIsPalindrome    = 24, // Param is pointer to a Boolean
  49.    mcActionSetGrowBoxBounds       = 25, // Param is pointer to a Rect
  50.    mcActionControllerSizeChanged  = 26, // No param
  51.    mcActionSetSelectionBegin      = 29, // Param is pointer to TimeRecord
  52.    mcActionSetSelectionDuration   = 30, // Param is pointer to TimeRecord
  53.    mcActionSetKeysEnabled         = 32, // Param is Boolean
  54.    mcActionGetKeysEnabled         = 33, // Param is pointer to Boolean
  55.    mcActionSetPlaySelection       = 34, // Param is Boolean
  56.    mcActionGetPlaySelection       = 35, // Param is pointer to Boolean
  57.    mcActionSetUseBadge            = 36, // Param is Boolean
  58.    mcActionGetUseBadge            = 37, // Param is pointer to Boolean
  59.    mcActionSetFlags               = 38, // Param is LONG flags
  60.    mcActionGetFlags               = 39, // Param is pointer to LONG flags
  61.    mcActionSetPlayEveryFrame      = 40, // Param is Boolean
  62.    mcActionGetPlayEveryFrame      = 41, // Param is pointer to Boolean
  63.    mcActionGetPlayRate            = 42, // Param is pointer to LFIXED
  64.    mcActionBadgeClick             = 44, // Param is pointer to Boolean
  65.    mcActionMovieClick             = 45, // Param is pointer to event structure
  66.    mcActionGetTimeSliderRect      = 49, // Param is pointer to RECT
  67.    mcActionGetSelectionBegin      = 53, // Param is pointer to TimeRecord
  68.    mcActionGetSelectionDuration   = 54  // Param is pointer to TimeRecord
  69.   } mcActionType;
  70.  
  71.  
  72. // Movie Controller MCDoAction, action McActionSetFlags parameter, movie
  73. // controller structure parameter, lfActionFlags
  74. // ---------------------------------------------------------------------
  75. typedef enum
  76.   {mcFlagSuppressStepButtons      = 1<<1,
  77.    mcFlagSuppressSpeakerButton    = 1<<2,
  78.    mcFlagsUseWindowPalette        = 1<<3
  79.   } mcActionFlags;
  80.  
  81.  
  82. // Toolbox function NewMovieController and Movie Controller function
  83. // MCPositionController parameter controllerCreationFlags values,
  84. // movie controller structure parameter, lfControllerStateFlags
  85. // -----------------------------------------------------------------
  86. typedef enum
  87.   {mcTopLeftMovie                 = 1<<0,
  88.    mcScaleMovieToFit              = 1<<1,
  89.    mcWithBadge                    = 1<<2,
  90.    mcNotVisible                   = 1<<3
  91.   } mcControllerStateFlags;
  92.  
  93.  
  94. // Movie Controller function MCGetControllerInfo parameter mcInfoFlags
  95. // parameter, movie controller structure parameter, lfControllerInfoFlags
  96. // ----------------------------------------------------------------------
  97. typedef enum
  98.   {mcInfoHasSound                 = 1<<5,
  99.    mcInfoIsPlaying                = 1<<6,
  100.    mcInfoIsLooping                = 1<<7,
  101.    mcInfoIsInPalindrome           = 1<<8
  102.   } mcControllerInfoFlags;
  103.  
  104.  
  105. // NewMovieFromFile flags
  106. // ----------------------
  107. typedef enum
  108.   {newMovieActive                 = 1<<0,
  109.    newMovieDontResolveDataRefs    = 1<<1,
  110.    newMovieDontAskUnresolvedDataRefs = 1<<2,
  111.    newMovieDontAutoAlternates     = 1<<3
  112.   } newMovieFlags;
  113.  
  114.  
  115. // Flags for SetMoviePlayHints
  116. // ---------------------------
  117. typedef enum
  118.   {hintsScrubMode                 = 1<<0,
  119.    hintsLoop                                  = 1<<1,
  120.    hintsInterpolateSound          = 1<<7,
  121.    hintsInactive                  = 1<<11
  122.   } moviePlayHints;
  123.  
  124.  
  125. // Flags for MovieSearchText
  126. // -------------------------
  127.  
  128. #define findTextEdgeOK                (1L << 0)
  129. #define findTextCaseSensitive         (1L << 1)
  130. #define findTextReverseSearch         (1L << 2)
  131. #define findTextWrapAround            (1L << 3)
  132. #define findTextUseOffset             (1L << 4)
  133. #define searchTextDontGoToFoundTime   (1L << 16)
  134. #define searchTextDontHiliteFoundText (1L << 17)
  135. #define searchTextOneTrackOnly        (1L << 18) /*ignored*/
  136. #define searchTextEnabledTracksOnly   (1L << 19)
  137.  
  138.  
  139. // Flags for GetMovieIndTrackType
  140. typedef enum
  141.   {movieTrackMediaType        = 1<<0,
  142.    movieTrackCharacteristic   = 1<<1,
  143.    movieTrackEnabledOnly      = 1<<2
  144.   } movieIndTrackTypeFlags;
  145.  
  146. #define VideoMediaType  QTFOURCC('v','i','d','e')
  147. #define SoundMediaType  QTFOURCC('s','o','u','n')
  148. #define TextMediaType   QTFOURCC('t','e','x','t')
  149. #define MPEGMediaType   QTFOURCC('m','p','e','g')
  150. #define MusicMediaType  QTFOURCC('m','u','s','i')
  151.  
  152. // Manifest constants for ostypes as flags for Component Manager calls
  153. // -------------------------------------------------------------------
  154. #define kAnyComponentType           0
  155. #define kAnyComponentSubType        0
  156. #define kAnyComponentManufacturer   0
  157. #define kAnyComponentFlagsMask      0
  158.  
  159.  
  160. // SetDefaultComponent Flags
  161. // -------------------------
  162. typedef enum
  163.   {defaultComponentIdentical        = 0,
  164.    defaultComponentAnyFlags         = 1,
  165.    defaultComponentAnyManufacturer  = 2,
  166.    defaultComponentAnySubType       = 4
  167.   } defaultComponentFlags;
  168.  
  169.  
  170. // RegisterComponent Flags
  171. // -----------------------
  172. typedef enum
  173.   {registerComponentGlobal          = 1,
  174.    registerComponentNoDuplicates    = 2,
  175.    registerComponentAfterExisting   = 4
  176.   } registerComponentFlags;
  177.  
  178. // putMovieIntoTypedHandle
  179. // -----------------------
  180. typedef enum
  181.   {
  182.     pmithHandleIsPointerToHandle    = 1
  183.   } pmithFlags;
  184.  
  185.  
  186. // Error codes
  187. // -------------
  188. enum
  189.   {
  190.    // Shared by QTW and QT Mac
  191.    readErr                        = -19,
  192.    paramErr                       = -50,
  193.    noTypeErr                      = -102,
  194.    insufficientMemory             = -108,
  195.    memWZErr                       = -111,
  196.    notLockedErr                   = -623,
  197.    couldNotResolveDataRef         = -2000,
  198.    badImageDescription            = -2001,
  199.    badPublicMovieAtom             = -2002,
  200.    cantFindHandler                = -2003,
  201.    cantOpenHandler                = -2004,
  202.    badComponentType               = -2005,
  203.    noMediaHandler                 = -2006,
  204.    noDataHandler                  = -2007,
  205.    invalidMedia                   = -2008,
  206.    invalidTrack                   = -2009,
  207.    invalidMovie                   = -2010,
  208.    invalidSampleTable             = -2011,
  209.    invalidDataRef                 = -2012,
  210.    invalidHandler                 = -2013,
  211.    invalidDuration                = -2014,
  212.    invalidTime                    = -2015,
  213.    cantPutPublicMovieAtom         = -2016,
  214.    badEditList                    = -2017,
  215.    mediaTypesDontMatch            = -2018,
  216.    progressProcAborted            = -2019,
  217.    movieToolboxUninitialized      = -2020,
  218.    wffileNotFound                 = -2021,
  219.    cantCreateSingleForkFile       = -2022,
  220.    invalidEditState               = -2023,
  221.    nonMatchingEditState           = -2024,
  222.    staleEditState                 = -2025,
  223.    userDataItemNotFound           = -2026,
  224.    maxSizeToGrowTooSmall          = -2027,
  225.    badTrackIndex                  = -2028,
  226.    trackIDNotFound                = -2029,
  227.    trackNotInMovie                = -2030,
  228.    timeNotInTrack                 = -2031,
  229.    timeNotInMedia                 = -2032,
  230.    badEditIndex                   = -2033,
  231.    internalQuickTimeError         = -2034,
  232.    cantEnableTrack                = -2035,
  233.    invalidRect                    = -2036,
  234.    invalidSampleNum               = -2037,
  235.    invalidChunkNum                = -2038,
  236.    invalidSampleDescIndex         = -2039,
  237.    invalidChunkCache              = -2040,
  238.    invalidSampleDescription       = -2041,
  239.    dataNotOpenForRead             = -2042,
  240.    dataNotOpenForWrite            = -2043,
  241.    dataAlreadyOpenForWrite        = -2044,
  242.    dataAlreadyClosed              = -2045,
  243.    endOfDataReached               = -2046,
  244.    dataNoDataRef                  = -2047,
  245.    noMovieInDataFork              = -2048,
  246.    invalidDataRefContainer        = -2049,
  247.    badDataRefIndex                = -2050,
  248.    noDefaultDataRef               = -2051,
  249.    couldNotUseAnExistingSample    = -2052,
  250.    featureUnsupported             = -2053,
  251.    noVideoTrackInMovie            = -2054,
  252.    noSoundTrackInMovie            = -2055,
  253.    movieTextNotFound              = -2062,
  254.  
  255.    // -2150 through -2200 reserved for QTW
  256.    soundSupportNotAvailable       = -2150,
  257.    maxControllersExceeded         = -2152,
  258.    unableToCreateMCWindow         = -2153,
  259.    invalidUserDataHandle          = -2154,
  260.    noPictureInFile                = -2155,
  261.    invalidPictureFileHandle       = -2156,
  262.    invalidPictureHandle           = -2157,
  263.    badDisplayContext              = -2158,
  264.    noMusicTrackInMovie            = -2159,
  265.    noTextTrackInMovie             = -2160,
  266.    noMPEGTrackInMovie             = -2161,
  267.  
  268.    // Shared by QTW and QT Mac
  269.    invalidComponentID             = -3000,
  270.    validInstancesExist            = -3001,
  271.    componentNotCaptured           = -3002,
  272.    componentDontRegister          = -3003,
  273.  
  274.    // Odds and ends used by QTW only
  275.    noErr                          = 0,
  276.    mcOK                           = 0,
  277.    mcEventNotHandled              = 0,
  278.    mcEventHandled                 = 1,
  279.    codecConditionErr              = -8972,
  280.    controllerBoundsNotExact       = -9996,
  281.    editingNotAllowed              = -9995
  282.   };
  283.  
  284.  
  285. // QTInitialize error codes
  286. // ------------------------
  287. enum
  288.   {QTI_OK                         = 0,
  289.    QTI_FAIL_NOEXIST               = 1,
  290.    QTI_FAIL_CORRUPTDLL            = 2,
  291.    QTI_FAIL_286                   = 3,
  292.    QTI_FAIL_WIN30                 = 4
  293.   };
  294.  
  295.  
  296. // Component Manager error codes
  297. // -----------------------------
  298. #define badComponentInstance    0x80008001
  299. #define badComponentSelector    0x80008002
  300.  
  301.  
  302. // Special MCI Interface
  303. // ---------------------
  304. #define MCI_QTW_PLAY_WINDOW     0x01000000L
  305. #define MCI_QTW_PLAY_FULLSCREEN 0x02000000L
  306. #define MCI_QTW_SET_USE_MC      0x00100000L
  307. #define MCI_QTW_SET_PAL_ASSERT  0x00200000L
  308. #define MCI_QTW_SET_GROWBOX     0x00400000L
  309.  
  310.  
  311. // Declared handles
  312. // ----------------
  313. DECLARE_HANDLE(UserData);              // Hungarian: ud
  314. DECLARE_HANDLE(PicHandle);             // Hungarian: ph
  315. DECLARE_HANDLE(DIBHandle);             // Hungarian: dh
  316. DECLARE_HANDLE(PicFile);               // Hungarian: pic
  317. DECLARE_HANDLE(MovieFile);             // Hungarian: mov
  318.  
  319. // Typedef's
  320. // ---------
  321. typedef LONG ComponentResult;          // Hungarian: cr
  322. typedef LONG OSErr;                    // Hungarian: oserr
  323. typedef LONG OSType;                   // Hungarian: ostype
  324. typedef void far *ProgressProcRecordPtr; // Hungarian: pprp
  325. typedef LONG TimeScale;                // Hungarian: ts
  326. typedef DWORD TimeValue;               // Hungarian: tv
  327. typedef LONG LFIXED;                   // Hungarian: lfx
  328. typedef LONG Fixed;                    // Hungarian: fx
  329. typedef short SFIXED;                  // Hungarian: sfx
  330. typedef BOOL Boolean;
  331. typedef HWND WindowPtr;
  332. typedef LPBYTE Ptr;
  333. typedef void far *AlignmentProcRecordPtr;
  334.  
  335. #ifndef RC_INVOKED
  336.     #if defined(_MSC_VER) || defined(__BORLANDC__)
  337.     #pragma pack(1)
  338.     #else
  339.     #error check structure packing options for your compiler
  340.     // search below for "#pragma pack" to find all the places
  341.     // to change for your compiler's pragma.
  342.     #endif
  343. #endif
  344.  
  345. struct Point {
  346.     short                       v;
  347.     short                       h;
  348. };
  349. typedef struct Point Point;
  350.  
  351. typedef struct _tagRect {
  352.    short        boxTop ;            // default text box
  353.    short        boxLeft ;
  354.    short        boxBottom ;
  355.    short        boxRight ;
  356. } Rect;
  357. #if !defined(RC_INVOKED) && (defined(_MSC_VER) || defined(__BORLANDC__))
  358.     #pragma pack()
  359. #endif
  360.  
  361. enum  {
  362.     nullEvent                   = 0,
  363.     mouseDown                   = 1,
  364.     mouseUp                     = 2,
  365.     keyDown                     = 3,
  366.     keyUp                       = 4,
  367.     autoKey                     = 5,
  368.     updateEvt                   = 6,
  369.     diskEvt                     = 7,
  370.     activateEvt                 = 8,
  371.     osEvt                       = 15,
  372. /* event mask equates */
  373.     mDownMask                   = 2,
  374.     mUpMask                     = 4,
  375.     keyDownMask                 = 8,
  376.     keyUpMask                   = 16,
  377.     autoKeyMask                 = 32,
  378.     updateMask                  = 64,
  379.     diskMask                    = 128,
  380.     activMask                   = 256,
  381.     highLevelEventMask          = 1024,
  382.     osMask                      = -32768
  383. };
  384.  
  385. struct EventRecord {
  386.     short                       what;
  387.     long                        message;
  388.     long                        when;
  389.     Point                       where;
  390.     short                       modifiers;
  391. };
  392. typedef struct EventRecord EventRecord;
  393.  
  394. typedef struct _tagInt64               // Hungarian: qw (quad word)
  395.   {DWORD dwLo;
  396.    LONG  dwHi;
  397.   } Int64;
  398.  
  399. #if !defined(RC_INVOKED) && (defined(_MSC_VER) || defined(__BORLANDC__))
  400.     #pragma pack(1)
  401. #endif
  402. typedef struct _tagOpenCPicParms       // Hungarian: ocp
  403.   {Rect   rect;
  404.    LFIXED hRes;
  405.    LFIXED vRes;
  406.    WORD   wVersion;
  407.    WORD   wReserved1;
  408.    DWORD  dwReserved2;
  409.   } OpenCPicParams;
  410.  
  411. typedef struct _tagTimeBaseRecord      // Hungarian: tbr
  412.   {DWORD FAR *p;
  413.   } TimeBaseRecord;
  414.  
  415. typedef TimeBaseRecord FAR *TimeBase;  // Hungarian: tb
  416.  
  417. #define TIMEBASE_DEFAULT ((TimeBase) 0L)
  418.  
  419. typedef struct _tagTimeRecord          // Hungarian: tr
  420.   {Int64     value;
  421.    TimeScale scale;
  422.    TimeBase  base;
  423.   } TimeRecord;
  424.  
  425. typedef struct MatrixRecord {          // Hungarian: mrec
  426.     Fixed matrix[3][3];
  427. } MatrixRecord;
  428.  
  429. typedef struct _tagSoundDescription    // Hungarian: sd (SoundDescription)
  430.   {LONG  descSize;                     // structure size
  431.    DWORD dataFormat;                   // 'raw ','twos','ima4'
  432.    DWORD resvd1;                       // always 0
  433.    WORD  resvd2;                       // always 0
  434.    WORD  dataRefIndex;                 // always 1
  435.    WORD  version;                      // always 0
  436.    WORD  revLevel;                     // always 0
  437.    DWORD vendor;                       // always 0
  438.    WORD  numChannels;                  // 1=mono; 2=stereo
  439.    WORD  sampleSize;                   // 8=8bit sound; 16=16bit sound
  440.    WORD  compressionID;                // always 0
  441.    WORD  packetSize;                   // always 0
  442.    LFIXED sampleRate;                  // eg: 44100.0000 per second
  443.   } SoundDescription;
  444.  
  445. typedef struct _tagMusicDescription    // Hungarian: md (MusicDescription)
  446.   {LONG  descSize;                     // structure size
  447.    DWORD dataFormat;                   // always 'musi'
  448.    DWORD resvd1;                       // always 0
  449.    WORD  resvd2;                       // always 0
  450.    WORD  dataRefIndex;                 // always 1
  451.    DWORD musicFlags;                   // always 0
  452.   } MusicDescription;
  453.  
  454. typedef struct _tagRGBColor {
  455.     unsigned short  red;             /*magnitude of red component*/
  456.     unsigned short  green;          /*magnitude of green component*/
  457.     unsigned short  blue;           /*magnitude of blue component*/
  458. } RGBColor;
  459.  
  460. typedef unsigned char Style;
  461.  
  462. typedef struct _tagScrpSTElement {
  463.     long                        scrpStartChar;                  /*starting character position*/
  464.     short                       scrpHeight;                     /*starting character position*/
  465.     short                       scrpAscent;
  466.     short                       scrpFont;
  467.     Style                       scrpFace;                       /*unpacked byte*/
  468.     char                        filler;                         /*scrpFace is unpacked byte*/
  469.     short                       scrpSize;
  470.     RGBColor                    scrpColor;
  471. } ScrpSTElement;
  472.  
  473. typedef struct _tagTextDescription {
  474.    long         descSize;
  475.    long         dataFormat;             // = 'text'
  476.    long         resvd1;
  477.    short        resvd2;
  478.    short        dataRefIndex;
  479.    long         displayFlags;
  480.    long         textJustification;
  481.    RGBColor     bgColor ;               // red, green, blue
  482.    Rect         defaultTextBox;
  483.    ScrpSTElement defaultStyle;          // default style
  484.    char         defaultFontName[ 1] ;   // pascal string ... struct is sized to fit the string
  485. } TextDescription;
  486.  
  487. typedef struct _tagMPEGDescription {
  488.     long descSize;
  489.     long dataFormat;
  490.     long resvd1;
  491.     short resvd2;
  492.     short dataRefIndex;
  493. } MPEGDescription;
  494.  
  495. typedef struct _tagImageDescription    // Hungarian: id (ImageDescription)
  496.   {LONG  idSize;                       // structure size
  497.    DWORD CodecType;                    // 'rpza', 'jpeg', 'rle ', 'raw ', 'smc', 'cvid'
  498.    DWORD resvd1;                       //
  499.    WORD  resvd2;                       // always 0
  500.    WORD  dataRefIndex;                 // always 1
  501.    WORD  version;                      //
  502.    WORD  revLevel;                     //
  503.    DWORD vendor;                       // 'appl' or other vendor
  504.    DWORD temporalQuality;              //
  505.    DWORD spatialQuality;               //
  506.    WORD  width;                        // Source image width in pixels
  507.    WORD  height;                       // Source image height in pixels
  508.    LFIXED hRes;                        // Horizontal resolution (eg: 72.0)
  509.    LFIXED vRes;                        // Vertical resolution (eg: 72.0)
  510.    DWORD dataSize;                     // Memory required for image data
  511.    WORD  frameCount;                   // always 0
  512.    char  name[32];                     // Compression algorithm (eg: Animation)
  513.    WORD  depth;                        // Pixel depth of source image
  514.    WORD  clutID;                       // Macintosh ROM Color table ID
  515.   } ImageDescription;
  516. #if !defined(RC_INVOKED) && (defined(_MSC_VER) || defined(__BORLANDC__))
  517.     #pragma pack()
  518. #endif
  519.  
  520. typedef ComponentResult (FAR  CDECL *ComponentRoutine) (VOID);
  521. typedef DWORD (FAR CDECL *ENTRYFUNC) (VOID);
  522. typedef VOID (FAR QTW_PASCAL *FIXUPFUNC) (ENTRYFUNC);
  523. typedef LONG Component;
  524. typedef LONG ComponentInstance;
  525.  
  526. typedef struct tagComponentDescription { // Hungarian: cd
  527.   OSType  ostypeComponentType;         // component identifier
  528.   OSType  ostypeComponentSubType;      // sub-type
  529.   OSType  ostypeComponentManufacturer; // vendor ID
  530.   DWORD   dwComponentFlags;            // control flags
  531.   DWORD   dwComponentFlagsMask;        // mask for control flags
  532.   ComponentRoutine   crEntryPoint;     // pointer to entry point
  533.   HRSRC   hrsrcName;                   // handle to name string
  534.   HRSRC   hrsrcInfo;                   // handle to info string
  535.   HRSRC   hrsrcIcon;                   // handle to icon
  536. } ComponentDescription, FAR *LPCD;
  537.  
  538.  
  539. // Macros
  540. // ------
  541. #define MAKELFIXED(integ, fract) ((LONG)(((WORD)(fract)) | (((DWORD)((WORD)(integ))) << 16)))
  542.  
  543. #define MAKESFIXED(integ, fract) ((int)(((BYTE)(fract)) | (((WORD)((BYTE)(integ))) << 8)))
  544.  
  545. #define QTFOURCC(ch0, ch1, ch2, ch3)                                \
  546.          ((DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) |  \
  547.          ((DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ))
  548.  
  549.  
  550. // ToolBox Callbacks and Handles
  551. // -----------------------------
  552. typedef const struct _tagQTHandle { int unused; } FAR *Handle;
  553. typedef long Size;
  554. typedef LPVOID Movie;
  555. typedef LPVOID Media;
  556. typedef LPVOID Track;
  557. typedef Handle SampleDescriptionHandle;
  558. typedef Handle PaletteHandle;
  559. enum {
  560.     pmAnimated  = 0x0004,   /*reserve an index on each device touched and render ciRGB.*/
  561. };
  562.  
  563. typedef OSErr (CALLBACK *MovieRgnCoverProc) (Movie, HDC, LONG);
  564.  
  565.  
  566. // Movie Controller Callbacks and Handles
  567. // --------------------------------------
  568. typedef ComponentInstance MovieController;
  569. typedef BOOL (CALLBACK *MCActionFilter) (MovieController, UINT, LPVOID, LONG);
  570.  
  571. // Support C++ Function Invocations
  572. // --------------------------------
  573. #ifdef __cplusplus
  574.   extern "C" {
  575. #endif
  576.  
  577.  
  578. // Function calling convention
  579. // ---------------------------
  580.  
  581. #define QTAPI FAR CDECL
  582.  
  583. // Macintosh toolbox equivalents
  584. // -----------------------------
  585.  
  586. Handle  QTAPI    NewHandle          ( Size byteCount);
  587. LPVOID  QTAPI    DereferenceHandle  ( Handle theHandle);
  588. void    QTAPI    HLock              ( Handle theHandle);
  589. void    QTAPI    HUnlock            ( Handle theHandle);
  590. Size    QTAPI    GetHandleSize      ( Handle theHandle);
  591. OSErr   QTAPI    MemError           ( VOID);
  592. void    QTAPI    SetHandleSize      ( Handle theHandle, Size newSize);
  593. void    QTAPI    DisposeHandle      ( Handle theHandle);
  594. signed char QTAPI  HGetState        ( Handle theHandle);
  595. void    QTAPI    HSetState          ( Handle theHandle,signed char newState);
  596.  
  597.  
  598. // Quicktime Functions
  599. // -------------------
  600.  
  601.  
  602.  
  603. OSErr           QTAPI QTInitialize (LPLONG);
  604. VOID            QTAPI QTTerminate (VOID);
  605. VOID            QTAPI  AddTime ( TimeRecord FAR *, const TimeRecord FAR *);
  606. VOID            QTAPI  AlignWindow ( WindowPtr wp, Boolean front, LPRECT aligmentRect,AlignmentProcRecordPtr alignmentProc);
  607. VOID            QTAPI  ClearMoviesStickyError ( VOID);
  608. OSErr           QTAPI  CloseMovieFile ( MovieFile);
  609. OSErr           QTAPI  ClosePictureFile ( PicFile);
  610. VOID            QTAPI  ConcatMatrix( const MatrixRecord FAR *srcMatrix,MatrixRecord FAR *destMatrix);
  611. VOID            QTAPI  ConvertTimeScale ( TimeRecord FAR *, TimeScale);
  612. LONG            QTAPI  CountUserDataType ( UserData, OSType);
  613. OSErr           QTAPI  DeleteMovieFile ( LPCSTR);
  614. VOID            QTAPI  DisposeMovie ( Movie);
  615. VOID            QTAPI  DisposeMovieController ( MovieController);
  616. VOID            QTAPI  DisposePicture ( PicHandle);
  617. OSErr           QTAPI  DrawPicture ( HDC, PicHandle, const LPRECT, ProgressProcRecordPtr);
  618. OSErr           QTAPI  DrawPictureFile ( HDC, PicFile, const LPRECT, ProgressProcRecordPtr);
  619. OSErr           QTAPI  EnterMovies ( VOID);
  620. VOID            QTAPI  ExitMovies ( VOID);
  621. VOID            QTAPI  GetMediaHandlerDescription( Media,OSType FAR *,LPSTR,OSType FAR *);
  622. short           QTAPI  GetMediaLanguage ( Media);
  623. OSErr           QTAPI  GetMediaSample ( Media, Handle, long, long FAR *,
  624.                 TimeValue, TimeValue FAR *, TimeValue FAR *,
  625.                 SampleDescriptionHandle,
  626.                 long FAR *, long, long FAR *,
  627.                 short FAR *);
  628. VOID            QTAPI  GetMediaSampleDescription( Media,LONG,SampleDescriptionHandle);
  629. TimeScale       QTAPI  GetMediaTimeScale ( Media);
  630. Track           QTAPI  GetMediaTrack ( Media);
  631. Boolean         QTAPI  GetMovieActive ( Movie);
  632. VOID            QTAPI  GetMovieActiveSegment ( Movie, TimeValue FAR *, TimeValue FAR *);
  633. VOID            QTAPI  GetMovieBox ( Movie, LPRECT);
  634. LONG            QTAPI  GetMovieCreationTime ( Movie);
  635. LONG            QTAPI  GetMovieDataSize ( Movie, TimeValue, TimeValue);
  636. TimeValue       QTAPI  GetMovieDuration ( Movie);
  637. Track           QTAPI  GetMovieIndTrack ( Movie, LONG);
  638. Track           QTAPI  GetMovieIndTrackType ( Movie, LONG, OSType, LONG);
  639. VOID            QTAPI  GetMovieMatrix( Movie theMovie,MatrixRecord FAR *theMatrix);
  640. LONG            QTAPI  GetMovieModificationTime ( Movie);
  641. PicHandle       QTAPI  GetMoviePict ( Movie, TimeValue);
  642. PicHandle       QTAPI  GetMoviePosterPict ( Movie);
  643. TimeValue       QTAPI  GetMoviePosterTime ( Movie);
  644. LFIXED          QTAPI  GetMoviePreferredRate ( Movie);
  645. SFIXED          QTAPI  GetMoviePreferredVolume ( Movie);
  646. VOID            QTAPI  GetMovieSelection ( Movie, TimeValue FAR *, TimeValue FAR *);
  647. OSErr           QTAPI  GetMoviesError ( VOID);
  648. OSErr           QTAPI  GetMoviesStickyError ( VOID);
  649. ComponentResult QTAPI  GetMovieStatus ( Movie, LPVOID);
  650. TimeValue       QTAPI  GetMovieTime ( Movie, TimeRecord FAR *);
  651. TimeScale       QTAPI  GetMovieTimeScale ( Movie);
  652. LONG            QTAPI  GetMovieTrackCount ( Movie);
  653. UserData        QTAPI  GetMovieUserData ( Movie);
  654. OSType          QTAPI  GetNextUserDataType ( UserData, OSType);
  655. OSErr           QTAPI  GetPictureFileHeader ( PicFile, LPRECT, OpenCPicParams FAR *);
  656. OSErr           QTAPI  GetPictureFileInfo ( PicFile, ImageDescription FAR *);
  657. PicHandle       QTAPI  GetPictureFromFile ( PicFile);
  658. OSErr           QTAPI  GetPictureInfo ( PicHandle, ImageDescription FAR *);
  659. HPALETTE        QTAPI  GetPicturePalette ( PicHandle);
  660. OSErr           QTAPI  GetSoundInfo ( Movie, SoundDescription FAR *);
  661. VOID            QTAPI  GetTrackDimensions( Track theTrack,Fixed FAR *width,Fixed FAR *height);
  662. Boolean         QTAPI  GetTrackEnabled ( Track th);
  663. Media           QTAPI  GetTrackMedia ( Track);
  664. VOID            QTAPI  GetTrackMatrix( Track theTrack,MatrixRecord FAR *theMatrix);
  665. Movie           QTAPI  GetTrackMovie ( Track);
  666. PaletteHandle   QTAPI  GetTrackPalette( Track);
  667. PicHandle       QTAPI  GetTrackPict ( Track, TimeValue);
  668. OSErr           QTAPI  GetUserData ( UserData, LPHANDLE, OSType, LONG, LPLONG);
  669. OSErr           QTAPI  GetUserDataText ( UserData, LPHANDLE, OSType, LONG, UINT, LPLONG);
  670. OSErr           QTAPI  GetVideoInfo ( Movie, ImageDescription FAR *);
  671. VOID            QTAPI  KillPicture ( PicHandle);
  672. OSErr           QTAPI  MovieSearchText ( Movie, Ptr, long, long, Track FAR *, TimeValue FAR *, long FAR *);
  673. MovieController QTAPI  NewMovieController ( Movie, const LPRECT, LONG, HWND);
  674. #ifndef _WIN32
  675.  OSErr           QTAPI  NewMovieFromDataFork ( Movie FAR *, HFILE, LONG, UINT);
  676. #else
  677.  OSErr           QTAPI  NewMovieFromDataFork ( Movie FAR *, HANDLE, LONG, UINT);
  678. #endif
  679. OSErr           QTAPI  NewMovieFromFile ( Movie FAR *, MovieFile, LPINT, LPSTR, UINT, Boolean FAR *);
  680. VOID            QTAPI  NormalizeRect ( LPRECT);
  681. OSErr           QTAPI  OpenMovieFile ( LPCSTR, MovieFile FAR *, UINT);
  682. OSErr           QTAPI  OpenPictureFile ( LPCSTR, PicFile FAR *, UINT);
  683. DIBHandle       QTAPI  PictureToDIB ( PicHandle);
  684. OSErr           QTAPI  PrerollMovie ( Movie, TimeValue, LFIXED);
  685. Boolean         QTAPI  PtInMovie ( Movie, POINT);
  686. Boolean         QTAPI  PtInTrack( Track theTrack,POINT thePoint);
  687. OSErr           QTAPI  PutMovieIntoTypedHandle( Movie, Track,
  688.                 OSType, Handle,TimeValue,TimeValue,LONG,ComponentInstance);
  689. VOID            QTAPI  SetEntryUsage( PaletteHandle dstPalette,short srcEntry, short srcUsage,short srcTolerance);                                
  690. VOID            QTAPI  SetMovieActive ( Movie, Boolean);
  691. VOID            QTAPI  SetMovieBox ( Movie, const LPRECT);
  692. VOID            QTAPI  SetMovieCoverProcs ( Movie, MovieRgnCoverProc, MovieRgnCoverProc, LONG);
  693. VOID            QTAPI  SetMoviePlayHints ( Movie, LONG, LONG);
  694. OSErr           QTAPI  SetTrackEnabled ( Track th, Boolean);
  695. VOID            QTAPI  SetTrackFollowCLUT ( Track th, Boolean);
  696. VOID            QTAPI  SubtractTime ( TimeRecord FAR *, const TimeRecord FAR *);
  697. TimeValue       QTAPI  TrackTimeToMediaTime ( TimeValue, Track);
  698. VOID            QTAPI  TransformRect( const MatrixRecord FAR *theMatrix,LPRECT theRect,LPVOID);
  699. OSErr           QTAPI  UpdateMovie ( Movie);
  700. ComponentResult QTAPI  MCActivate ( MovieController, HWND, Boolean);
  701. ComponentResult QTAPI  MCClick ( MovieController, HWND, Point, long, long);
  702. ComponentResult QTAPI  MCDoAction ( MovieController, UINT, LPVOID);
  703. ComponentResult QTAPI  MCDraw ( MovieController, HWND);
  704. ComponentResult QTAPI  MCDrawBadge ( MovieController, HRGN, HRGN FAR *);
  705. ComponentResult QTAPI  MCGetControllerBoundsRect ( MovieController, LPRECT);
  706. ComponentResult QTAPI  MCGetControllerInfo ( MovieController, LPLONG);
  707. TimeValue       QTAPI  MCGetCurrentTime ( MovieController, TimeScale FAR *);
  708. Movie           QTAPI  MCGetMovie ( MovieController);
  709. ComponentResult QTAPI  MCGetVisible ( MovieController);
  710. ComponentResult QTAPI  MCIdle ( MovieController);
  711. ComponentResult QTAPI  MCIsControllerAttached ( MovieController);
  712. ComponentResult QTAPI  MCIsPlayerMessage ( MovieController, HWND, UINT, WPARAM, LPARAM);
  713. ComponentResult QTAPI  MCKey ( MovieController, WPARAM, LPARAM);
  714. ComponentResult QTAPI  MCMovieChanged ( MovieController, Movie);
  715. OSErr           QTAPI  MCNewMovieController ( MovieController, ComponentInstance, Movie, const LPRECT, LONG, HWND);
  716. ComponentResult QTAPI  MCNewAttachedController ( MovieController, Movie, HWND, POINT);
  717. ComponentResult QTAPI  MCPositionController ( MovieController, LPRECT, LPRECT, LONG);
  718. ComponentResult QTAPI  MCRemoveMovie ( MovieController);
  719. ComponentResult QTAPI  MCSetActionFilter ( MovieController, MCActionFilter, LONG);
  720. ComponentResult QTAPI  MCSetControllerAttached ( MovieController, Boolean);
  721. ComponentResult QTAPI  MCSetControllerBoundsRect ( MovieController, const LPRECT);
  722. ComponentResult QTAPI  MCSetMovie ( MovieController, Movie, HWND, POINT);
  723. ComponentResult QTAPI  MCSetVisible ( MovieController, Boolean);
  724. Component       QTAPI  CaptureComponent ( Component cCaptured, Component cCapturing);
  725. OSErr           QTAPI  CloseComponent ( ComponentInstance ci);
  726. OSErr           QTAPI  CloseComponentResFile ( short sFileNum);
  727. LONG            QTAPI  ComponentFunctionImplemented ( ComponentInstance ci, short sFunctionNumber);
  728. LONG            QTAPI  CountComponentInstances ( Component c);
  729. LONG            QTAPI  CountComponents ( ComponentDescription FAR *lpcdLooking);
  730. Component       QTAPI  FindNextComponent ( Component c, ComponentDescription FAR *lpcdLooking);
  731. HINSTANCE       QTAPI  GetComponentResFileInstance ( short sFileNum);
  732. OSErr           QTAPI  GetComponentInfo ( Component c, ComponentDescription FAR *lpcd);
  733. OSErr           QTAPI  GetComponentInstanceError ( ComponentInstance ci);
  734. LPVOID          QTAPI  GetComponentInstanceStorage ( ComponentInstance ci);
  735. LONG            QTAPI  GetComponentListModSeed ( VOID);
  736. LONG            QTAPI  GetComponentRefcon ( Component c);
  737. LONG            QTAPI  GetComponentVersion ( ComponentInstance ci);
  738. ComponentInstance QTAPI  OpenComponent ( Component c);
  739. short           QTAPI  OpenComponentResFile ( Component c);
  740. ComponentInstance QTAPI  OpenDefaultComponent ( OSType ostypeComponentType, OSType ostypeComponentSubType);
  741. Component       QTAPI  RegisterComponent ( LPCD lpcd, WORD wGlobal, FIXUPFUNC lpfnTBFixup, FIXUPFUNC lpfnCMFixup);
  742. OSErr           QTAPI  RegisterComponentResourceFile ( LPCSTR lpszDLL, WORD wGlobal);
  743. VOID            QTAPI  SetComponentInstanceError ( ComponentInstance ci, OSErr oserr);
  744. VOID            QTAPI  SetComponentInstanceStorage ( ComponentInstance ci, LPVOID lpvStorage);
  745. VOID            QTAPI  SetComponentRefcon ( Component c, LONG lRefcon);
  746. OSErr           QTAPI  SetDefaultComponent ( Component c, short sFlags);
  747. OSErr           QTAPI  UncaptureComponent ( Component c);
  748. OSErr           QTAPI  UnregisterComponent ( Component c);
  749. OSErr           QTAPI  UnregisterComponentResourceFile ( LPCSTR lpszDLL);
  750.  
  751. // End of Functions
  752. // ----------------
  753. #ifdef __cplusplus
  754.   }
  755. #endif
  756.  
  757.  
  758. // End of QTW.H
  759. // ------------
  760. #endif // __QTW_H__
  761.